package net.towee.client.com.lobby.view;

import net.towee.client.com.lobby.presenter.LobbyGroupsPresenter.Display;
import net.towee.client.com.stuff.view.StuffView;
import net.towee.client.i18n.ToweeConstants;
import net.towee.client.resources.ClientResource;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.inject.Inject;

public class LobbyGroupsView extends StuffView implements Display {
	private Button nextButton;
	private Button closeButton;

	@Inject
	public LobbyGroupsView(ToweeConstants constants, ClientResource resource) {
		super(constants, resource);
		
		createButtons();
	}

	/**
	 * Build area with text information
	 */
	private void createButtons() {
		// Create buttons
		this.nextButton = new Button(constants.lobbyFirstStepContinue());
		this.closeButton = new Button(constants.lobbyClose());

		// Set styles
		closeButton.setStyleName(resource.css().lobbyCloseButton());
		nextButton.setStyleName(resource.css().lobbyNextStepButton());
		closeButton.getElement().getStyle().setProperty("position", "absolute");
		nextButton.getElement().getStyle().setProperty("position", "absolute");
		closeButton.getElement().getStyle().setProperty("top", "100px");
		nextButton.getElement().getStyle().setProperty("top", "100px");
		nextButton.getElement().getStyle().setProperty("left", "113px");
		add(closeButton);
		add(nextButton);
	}

	@Override
	public HasClickHandlers getNextButton() {
		return nextButton;
	}

	@Override
	public HasClickHandlers getCloseButton() {
		return closeButton;
	}
}
